<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>layui.dtree帮助手册</title>
<link rel="stylesheet" href="../../layui/css/layui.css">
<script type="text/javascript" src="../../layui/layui.js"></script>

<link rel="stylesheet" href="../../layui_ext/dtree/dtree.css">
<link rel="stylesheet" href="../../layui_ext/dtree/font/dtreefont.css">

<link rel="stylesheet" href="../online.css">
</head>
<body>

	<div class="container">
		<div class="layui-row layui-col-space10">
			<div class="layui-fluid">
				<fieldset class="layui-elem-field layui-field-title" id="basicData">
					<legend>复制这段url代码或data添加在示例中运行</legend>
					<div class="layui-field-box">
						<div class="layui-row layui-col-space10" style="margin-top: 10px;">
							<div class="layui-col-lg12">
								<pre class="layui-code" lay-title="url&配置项一览">
									url: "../json/case/commonTree4.json",
									method: "get",
									initLevel: "1"
								</pre>
							</div>
							<div class="layui-col-lg12">
								<pre class="layui-code" lay-title="data数据一览">
									var data = [{
		"id":"001",
		"title": "湖南省",
		"parentId": "0",
		"children":[{
			"id":"001001",
			"title": "长沙市",
			"parentId": "001"
		},{
			"id":"001002",
			"title": "株洲市",
			"parentId": "001"
		},{
			"id":"001003",
			"title": "湘潭市",
			"parentId": "001"
		},{
			"id":"001004",
			"title": "衡阳市",
			"parentId": "001"
		},{
			"id":"001005",
			"title": "郴州市",
			"parentId": "001"
		}]
	},{
		"id":"002",
		"title": "湖北省",
		"parentId": "0",
		"children":[{
			"id":"002001",
			"title": "武汉市"
		},{
			"id":"002002",
			"title": "黄冈市",
			"parentId": "002"
		},{
			"id":"002003",
			"title": "潜江市",
			"parentId": "002"
		},{
			"id":"002004",
			"title": "荆州市",
			"parentId": "002"
		},{
			"id":"002005",
			"title": "襄阳市",
			"parentId": "002"
		}]
	},{
		"id":"003",
		"title": "广东省",
		"parentId": "0",
		"spread": true,
		"children":[{
			"id":"003001",
			"title": "广州市",
			"parentId": "003",
			"children":[{
				"id":"003001001",
				"title": "天河区",
				"parentId": "003001"
			},{
				"id":"003001002",
				"title": "花都区",
				"parentId": "003001"
			}]
		},{
			"id":"003002",
			"title": "深圳市",
			"parentId": "003"
		},{
			"id":"003003",
			"title": "中山市",
			"parentId": "003"
		},{
			"id":"003004",
			"title": "东莞市",
			"parentId": "003"
		},{
			"id":"003005",
			"title": "珠海市",
			"parentId": "003"
		},{
			"id":"003006",
			"title": "韶关市",
			"parentId": "003"
		}]
	},{
		"id":"004",
		"title": "浙江省",
		"parentId": "0",
		"children":[{
			"id":"004001",
			"title": "杭州市",
			"parentId": "004"
		},{
			"id":"004002",
			"title": "温州市",
			"parentId": "004"
		},{
			"id":"004003",
			"title": "绍兴市",
			"parentId": "004"
		},{
			"id":"004004",
			"title": "金华市",
			"parentId": "004"
		},{
			"id":"004005",
			"title": "义乌市",
			"parentId": "004"
		}]
	},{
		"id":"005",
		"title": "福建省",
		"parentId": "0",
		"children":[{
			"id":"005001",
			"title": "厦门市",
			"parentId": "005"
		}]
	}]
								</pre>
							</div>
						</div>
					</div>
				</fieldset>
			</div>
		</div>
	</div>

</body>
<script type="text/javascript">
	layui.extend({
		dtree: '{/}../../layui_ext/dtree/dtree'
	}).use(['element','layer', 'table', 'code' ,'util', 'dtree'], function(){
		var element = layui.element,
			layer = layui.layer,
			table = layui.table,
			util = layui.util,
			dtree = layui.dtree,
			$ = layui.$;
		layui.code();	// 代码修饰器
		
	});
</script>
</html>